﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Game_Field
{
    public class GameField
    {
        private int gameFieldX;
        private int gameFieldY;
        private int height;
        private int width;

        public GameField(int x, int y, int height, int width)
        {
            GameFieldX = x;
            GameFieldY = y;
            Height = height;
            Width = width;
        }


        public int GameFieldX
        {
            get
            {
                return gameFieldX;
            }
            private set
            {
                if (value < 0)
                {
                    gameFieldX = 0;
                }
                else
                {
                    gameFieldX = value;
                };
            }
            
        }

        public int GameFieldY {
            get
            {
               return gameFieldY ;
            }

            private set
            {
                if (value < 0)
                {
                    gameFieldY = 0;
                }
                else
                {
                    gameFieldY = value;
                }
            }
        }

        public int Height {

            get
            {
                return height; ;
            }

            private set
            {
                if (value <= 0)
                    throw new ArgumentOutOfRangeException("Incorrect height");
                    height = value;
            }
        }

        public int Width {
            get
            {
                return width;
            }

            private set
            {
                if (value <= 0)
                    throw new ArgumentOutOfRangeException("Incorrect width");
                width = value;
            }
        }      
    }
}
